﻿using SqlSugar;
using System;
using WPFNote.Models.Utility;

namespace WPFNote.Models
{
    public class BaseEntitySch
    {
        [SugarColumn(IsIgnore = true)]
        [MySql("Ignore")]
        public int Page { get; set; } = 1;

        private int _size = 25;

        [SugarColumn(IsIgnore = true)]
        [MySql("Ignore")]
        public int Size
        {
            get => _size;
            set => _size = value > 50 ? 50 : value;
        }
        /// <summary>
        /// 数据提交时间-开始
        /// </summary>
        [MySql("Start")]
        public DateTime? PostTimeStart { get; set; }

        /// <summary>
        /// 数据提交时间-结束
        /// </summary>
        [MySql("End")]
        public DateTime? PostTimeEnd { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [MySql("Ignore")]
        public string OrderBy { get; set; } = "Id desc";
        /// <summary>
        /// 是否正序
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [MySql("Ignore")]
        public bool OrderAcs { get; set; } = false;
    }
}